package com.loveprogrammer.pool2.demo1;

/**
 * @ClassName Connector
 * @Description 池化的对象
 * @Author admin
 * @Date 2023/11/7 9:38
 * @Version 1.0
 */
public class Connector {

    public Connector(String id) {
        this.id = id;
    }

    private String id;

    public void create() {
        System.out.println("ThreadName:" + Thread.currentThread().getName() + " 对象:" + id + "正在被创建。。。。。。");

    }

    public void destroy() {
        System.out.println("ThreadName:" + Thread.currentThread().getName() + " 对象:" + id + "正在被销毁。。。。。。");

    }

    public boolean isValid() {
        System.out.println("ThreadName:" + Thread.currentThread().getName() + " 对象" + id + "正在检验是否可用。。。。。。");
        return true;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}
